import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;

public class Demo1 {
    public static void main(String[] args) throws InterruptedException {
        BlockingQueue<String> blockingQueue = new LinkedBlockingQueue<>();

        blockingQueue.put("hello");
        while(!blockingQueue.isEmpty()){
            System.out.println(blockingQueue.take());
        }
        //程序阻塞
        blockingQueue.take();
    }
}
